md2any 0.3.0 — math rendering overhaul, rendering robustness, docs & crate polish#1
Merged
Merged
Conversation
Math engine:
- Font-aware glyph metrics via a GlyphMetrics provider: the layout measures
advances against the face that will render them (embedded PDF font, or
bundled DejaVu for SVG/PNG), so equations stay aligned under --pdf-font.
- Real math bold (\mathbf, \boldsymbol, \bm, \pmb, \mathbfit); fixes the
\boldsymbol literal-leak.
- Accents (\bar, \hat, \vec, \tilde, \dot, \ddot) drawn as centred geometry
instead of zero-advance combining marks (which mis-placed per font, e.g.
\bar{d} -> "đ").
- Recognise \dfrac/\tfrac/\cfrac and \mid/\vert/\Vert (were leaking source).
PDF font embedding:
- Emit CIDFontType0 + FontFile3 for CFF/OpenType faces (e.g. STIX Two Math)
instead of mislabelling them as TrueType.
Rendering fixes:
- GFM table column alignment (:---:, ---:) honoured in PDF/SVG/PNG/HTML.
- Title slides (all layouts) and section dividers auto-shrink to fit; wrapped
content headings push the body/underline down instead of overprinting.
- Inline <svg> rasterised as an image instead of being dropped.
- Tabs in code expand to 4-column tab stops (no more notdef boxes).
- {width=N%} clamps instead of leaking literal attribute text.
- ::: columns handle leading/trailing/duplicate dividers (fence form).
- Task-list items show only their checkbox, not a bullet too.
- Display-math pagination weights equation images by aspect ratio so a
one-line equation no longer splits onto a near-empty continuation slide.
- Add examples/famous-equations.md — a wall of famous equations (Euler, E=mc^2, Lorentz, Schrodinger, Dirac, field equations, Bayes, Boltzmann, Basel), set for STIX via --pdf-font. - Consolidate the Standard Model Lagrangian onto a single -a4.md source, dropping the older markup/selectable/plain variants.
…o 0.3.0 - CHANGELOG: new [0.3.0] section (Added / Fixed / Known limitations). - README: correct the RTL/CJK claim (no full bidi; CJK needs --cjk), add task lists, table alignment, inline SVG, math bold/accents, and font-aware/OTF math metrics to the feature table. - docs/torture-test-findings.md: tracked findings from the rendering sweep with per-item status. - Bump version 0.2.0 -> 0.3.0.
- Nested blockquotes (`>`/`>>`/`>>>`) keep every level: the quote accumulator now resets only on the outermost quote instead of on every nested open, which had dropped all but the deepest level. - Long unbreakable tokens (URLs, hashes, CamelCase) hard-break to fit the line instead of overflowing the slide edge: PDF (wrap_text_simple / wrap_runs) and SVG (wrap_text) break over-long tokens into character chunks; HTML adds `overflow-wrap: anywhere`.
- Add docs/img/{slides,equations,lagrangian}.png and embed a gallery in the
README: a content/code/table montage at the top, a "Native math" section
with the equation montage (STIX) and the full Standard Model Lagrangian.
- Note the RTL (no full bidi) and Office table-alignment limitations honestly.
- CHANGELOG: add nested-blockquote and long-token-overflow fixes to [0.3.0].
- Update the torture-test findings tracker (M1/M2 done).
- Exclude the binary manual formats (docs/manual, ~1.2 MB — HELP.md already carries the text) and orphan pre-rendered sample PNGs from the published package: the crate drops from ~8.9 MB to ~5 MB while keeping the embedded fonts, README gallery, examples, and licenses. - Tidy the .gitignore editor-dir list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A math-rendering and robustness release, bumping to 0.3.0.
Math engine
GlyphMetricsprovider — the layout measures advances against the face that will actually render them (embedded PDF font, or bundled DejaVu for SVG/PNG), so equations stay aligned under--pdf-font.\mathbf,\boldsymbol,\bm,\pmb,\mathbfit); fixes the\boldsymbolliteral-leak.\bar,\hat,\vec,\tilde,\dot,\ddot) drawn as centred geometry instead of mis-placed zero-advance combining marks (e.g.\bar{d}→ "đ").\dfrac/\tfrac/\cfracand\mid/\vert/\Vert(were leaking source).PDF font embedding
CIDFontType0+FontFile3for CFF/OpenType faces (e.g. STIX Two Math) instead of mislabelling them TrueType, which strict readers rejected.Rendering fixes (from a full torture sweep)
:---:,---:) honoured in PDF/SVG/PNG/HTML.<svg>rasterised instead of dropped.{width=N%}>100clamps;:::fence columns handle leading/duplicate dividers; task-list items show only their checkbox; display-math pagination weights equations by aspect ratio.Docs & crate
[0.3.0];cargo docwarning-free.cargo publish --dry-runbuild-verifies the package.Tests
80 tests pass (incl. new regressions for metrics, bold, accents, CFF detection, table alignment, tabs, inline SVG, nested quotes, width clamp, fence columns, math pagination).
cargo fmtclean, 0 clippy errors.Known limitations (documented)
RTL has no full bidi reordering; CJK/emoji need
--cjkfor PDF; Office/ODF outputs don't carry table alignment yet.